import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'


Vue.use(VueRouter)

const routes = [
  {
	  //首页
    path: '/home',
    name: 'Home',
    component: Home,
	children:[
		{
		  path: '/home',
		  name: 'Main',
		  
		  component: () => import('../views/Main.vue')
		},
		{
		  path: '/home/shopCart',
		  name: 'ShopCart',
		  
		  component: () => import('../views/ShopCart.vue')
		},
		{
		  path: '/home/orders',
		  name: 'Orders',
		  
		  component: () => import('../views/Orders.vue')
		},
		{
		  path: '/home/mine',
		  name: 'Mine',
		  
		  component: () => import('../views/Mine.vue')
		},
	]
  },
  {
	  //测试
    path: '/about',
    name: 'About',
    
    component: () => import('../views/About.vue')
  },
  {
	  //登录
    path: '/',
    name: 'Login',
    
    component: () => import('../views/Login.vue')
  },
  {
	  //注册
    path: '/register',
    name: 'Register',
    
    component: () => import('../views/Register.vue')
  },
  {
	  //我的收获地址
    path: '/address',
    name: 'Address',
    
    component: () => import('../views/Address.vue')
  }, {
	  //编辑收获地址
    path: '/editadd',
    name: 'Editadd',
    
    component: () => import('../views/Editadd.vue')
  },
  {
	  //新建收获地址
    path: '/newadd',
    name: 'Newadd',
    
    component: () => import('../views/Newadd.vue')
  },
  {
	  //商家详情--选中购物车状态
    path: '/find',
    name: 'Find',
    component: () => import('../views/Find.vue'),
  },
  {
	  //商家详情--有金额
    path: '/merchant',
    name: 'Merchant',
    component: () => import('../views/Merchant.vue'),
  },
  {
	  //商家详情--购物车空状态
    path: '/empty',
    name: 'Empty',
    component: () => import('../views/Empty.vue'),
  },
  {
	  //支付成功页面
    path: '/payment',
    name: 'Payment',
    component: () => import('../views/Payment.vue'),
  },
  {
	  //搜索
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue'),
  },
  {
	  //搜索列表
    path: '/searchlist',
    name: 'Searchlist',
    component: () => import('../views/Searchlist.vue'),
  },
  {
	  //确认订单
    path: '/submission',
    name: 'Submission',
    component: () => import('../views/Submission.vue'),
  },
  {
	  //提交订单
    path: '/confirmorder',
    name: 'Confirmorder',
    component: () => import('../views/Confirmorder.vue'),
  },
]

const router = new VueRouter({
  routes
})

export default router
